﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Microsoft.Reporting.WebForms;

namespace PeisongWeb.admin
{
    public partial class sellerAssessmentAll_report : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt;
                if (Request.QueryString["sdt"] != null || Request.QueryString["edt"] != null)
                {
                    DateTime Sdt = Convert.ToDateTime(Request.QueryString["sdt"].ToString());
                    DateTime Edt = Convert.ToDateTime(Request.QueryString["edt"].ToString());

                    dt = DAL.DbHelper.ExecuteDataTable("P_AssessmentWeek_ByAllseller", Sdt, Edt);
                    ReportDataSource rds = new ReportDataSource("sellerAssessment_Data_DataTable1", dt);
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(rds);
                    ReportViewer1.LocalReport.Refresh();
                    if (dt.Rows.Count == 0)
                    {
                        ReportViewer1.Visible = false;
                        div_nodata.Visible = true;
                    }
                    else
                    {
                        div_nodata.Visible = false;
                    }
                }
                else
                {
                    Library.Script.ClientMsgUrl("错误的参数。", "reportCustomer.aspx");
                }
            }
        }
    }
}
